package com.ones.kit.oss.autoconfigure;

import com.ones.kit.oss.util.OnesOssUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;

/**
 * OSS文件存储
 *
 * @author Clark
 * @version 2024-07-19
 */
@Slf4j
@Lazy
@AutoConfiguration
@ConditionalOnProperty(value = "aizuda.oss.minio.platform")
public class OnesOssAutoConfiguration {
    /**
     *
     * @return
     */
    @Bean
    @ConditionalOnMissingBean
    public OnesOssUtils osOssUtils() {
        OnesOssUtils utils = new OnesOssUtils();
        log.warn("******************* Oss工具类自动装配完成 *******************");
        return utils;
    }
}